<%
taxon_name = @taxon_retrieved.name
taxon_specific_text_content = DataObject.find_taxon_specific_text_content(@taxon_retrieved)
taxon_specific_linkouts = DataObject.find_taxon_specific_linkouts(@taxon_retrieved)
%>

<H1><%= taxon_name %></H1>

<table border=1>
<% 
taxon_specific_text_content.each_pair do |data_provider, data_objects|
%>
  <%= render(:partial => "data_provider_brief", :object => data_provider) %>
  <%= render(:partial => "data_object", :collection => data_objects) %>
<%
end
%>
</table>
<% if taxon_specific_linkouts.size > 0 %>
  <H3>Linkouts for <%= taxon_name %></H3>
  <table>
  <% taxon_specific_linkouts.each_pair do |data_provider, data_objects| %>
    <%= render(:partial => "data_provider_brief", :object => data_provider) %>
    <%= render(:partial => "data_object", :collection => data_objects) %>
  <% end %>
  </table>
<% end %>

<% if @toxin_citations_for_taxon.size > 0 %>
<H2>Associated toxicity information</H2>
<% end %>

<%
@toxin_citations_for_taxon.each_pair do |toxin, citations|
  
  %>
  <H3><%= toxin.name %></H3>
  According to the following sources, this taxon is associated with <%= toxin.name %>:
  <UL>
  <% citations.each do |citation| %>
    <LI><a href="<%= citation.url %>"><%= citation.data_provider.full_name %></a>
  <% end %>
  </UL>
  <%

  toxin.data_objects.each do |data_object|
    if(data_object.content.nil?)
      %><tr><td colspan=2>Link to <a href="<%=data_object.url%>">information from <%=data_object.data_provider.full_name%>: <%=data_object.chapter.name%></a></td></tr><%
    else
      %>display the object here<%
    end
      #print_data_object(data_object)
  end
end

%>
